package com.ztgf.message.api.common.config;

import com.ztgf.message.model.constant.MessageTopicType;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author YUE
 * @create 2020-05-13 16:42
 */
@Configuration
public class KafkaBean {
    //创建TopicName分区数为8以及副本数为1
    @Bean
    public NewTopic initialTopic() {
        return new NewTopic(MessageTopicType.COMMENT_MESSAGE_TOPIC, 8, (short) 1);
    }

}
